<script setup lang="ts">
import { ref } from "vue";
import { type FormProps } from "./typs";
import dayjs from "dayjs";
const time = ref();
time.value = dayjs(new Date()).format("YYYY-MM-DD hh:mm:ss");
const props = withDefaults(defineProps<FormProps>(), {
  formInline: () => ({
    msgClass: "",
    msgTitle: "",
    id: 0,
    msgContext: "",
    addUser: 0,
    addTime: ""
  })
});

const ruleFormRef = ref();
const newFormInline = ref(props.formInline);

function getRef() {
  return ruleFormRef.value;
}

defineExpose({ getRef });
</script>
<template>
  <el-form :model="newFormInline" label-width="120px" ref="ruleFormRef">
    <el-form-item label="消息类型">
      <el-select v-model="newFormInline.msgClass" placeholder="请选择消息类型">
        <el-option label="系统消息" value="系统消息" />
        <el-option label="活动消息" value="活动消息" />
        <el-option label="通知公告" value="通知公告" />
        <el-option label="营销消息" value="营销消息" />
      </el-select>
    </el-form-item>
    <el-form-item label="标题内容">
      <el-input v-model="newFormInline.msgTitle" />
    </el-form-item>
    <el-form-item label="消息内容">
      <el-input v-model="newFormInline.msgContext" type="textarea" />
    </el-form-item>
  </el-form>
</template>
